<template>
	<div>
		<van-swipe class="my-swipe" 
		:autoplay="3000" 
		indicator-color="white"
		:width="width"
		:height="height"
		>	
		  <van-swipe-item v-for='(item,index) in images' :key='index' >
			  <img :src="item">
			  </van-swipe-item>
		</van-swipe>
	</div>
</template>

<script>
	import Vue from 'vue';
	import { Swipe, SwipeItem } from 'vant';
	Vue.use(Swipe);
	Vue.use(SwipeItem);
	export default {
		components:{
			Swipe,SwipeItem
		},
		props:{
			images:{
				type:Array,
				required:true,
				validator:function(array){
					return array.length!==0;
				}
			},
			autoplay:{
				type:Number||String,
				default:3000
			},
			width:{
				type:String,
				default:'auto'
			},
			height:{
				type:String,
				default:'auto'
			}
			
		},
		computed:{
			imageStyle:function(){
				return{
					width:"100%"
				}
			}
		}
		
		
	}
</script>

<style scoped>
img{
	width: 100%;
	height: 260px;
}
</style>